<?php 
class DocumentosController extends AppController{
    var $name = 'Documentos';
    
    function view(){ //configure::write('debug',2);
        $this->layout = 'ajax';
        $this->loadModel($this->params['pass']['0']);
        $model = $this->params['pass']['0'];
        $documento = $this->$model->findByDocumento_id($this->params['pass']['1']);
        echo json_encode(array('model'=>$model, 'id'=>$documento[$model]['id']));
        $this->autoRender = false;
    }
}
?>